public class homework2 {
    //  力扣 26. 删除有序数组中的重复项
    public int removeDuplicates(int[] nums) {

        int fast=1;
        int slow=1;
        if(nums.length==0){
            return 0;
        }
        while(fast<nums.length){
            if(nums[fast]!=nums[fast-1]){
                nums[slow]=nums[fast];
                slow++;

            }
            fast++;
        }
        return slow;
    }
}
